﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace S.Organization.Infrastructure.Migrations
{
    public partial class intrl : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "CottageSetting",
                columns: table => new
                {
                    CottageId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CottageType = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CottageName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Principal = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Production = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CottageState = table.Column<bool>(type: "bit", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CottageSetting", x => x.CottageId);
                });

            migrationBuilder.CreateTable(
                name: "DepartmentInfo",
                columns: table => new
                {
                    DepId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DepState = table.Column<bool>(type: "bit", nullable: false),
                    DEpType = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DepNumber = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DepArea = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Principal = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DepartmentInfo", x => x.DepId);
                });

            migrationBuilder.CreateTable(
                name: "FieldSetting",
                columns: table => new
                {
                    FieldId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FieldName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CottageId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FieldSetting", x => x.FieldId);
                });

            migrationBuilder.CreateTable(
                name: "SheepFarmSetting",
                columns: table => new
                {
                    SheepFarmId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FarmNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    FarmName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    FarmAbbreviation = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    FarmScale = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    AccountsDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Principal = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DetailedAddress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
                    Department = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepFarmSetting", x => x.SheepFarmId);
                });

            migrationBuilder.CreateTable(
                name: "UnitsSetup",
                columns: table => new
                {
                    UnitsSetupId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CompanyName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CompanyLOGO = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
                    LndustryLabel = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    DetailedAddress = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    CompanyPhone = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CreditNumber = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Describe = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true),
                    BlockUp = table.Column<bool>(type: "bit", nullable: false),
                    Principal = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    SearchablePerson = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UnitsSetup", x => x.UnitsSetupId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CottageSetting");

            migrationBuilder.DropTable(
                name: "DepartmentInfo");

            migrationBuilder.DropTable(
                name: "FieldSetting");

            migrationBuilder.DropTable(
                name: "SheepFarmSetting");

            migrationBuilder.DropTable(
                name: "UnitsSetup");
        }
    }
}
